//
//  SRWorkShareView.m
//  StoryShow
//
//  Created by CyonLeuMBP on 2017/6/7.
//  Copyright © 2017年 qudiandu.cn. All rights reserved.
//

#import "SRWorkShareView.h"
#import "UIButton+FZGreenButton.h"

@interface SRWorkShareView ()
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;

@property (weak, nonatomic) IBOutlet UIButton *showWorkButton;

@property (weak, nonatomic) IBOutlet UIView *shareContentView;
@property (weak, nonatomic) IBOutlet UILabel *shareTitleLabel;
@property (weak, nonatomic) IBOutlet UIImageView *weixinImageView;
@property (weak, nonatomic) IBOutlet UIImageView *weixinTimeLineImageView;
@property (weak, nonatomic) IBOutlet UIImageView *qzoneImageView;
@property (weak, nonatomic) IBOutlet UIImageView *qqImageView;





@end

@implementation SRWorkShareView

- (void)awakeFromNib {
    [super awakeFromNib];
    
    FZStyleSheet *css = [FZStyleSheet currentStyleSheet];
    
    self.titleLabel.font = css.fontOfH3;
    self.titleLabel.textColor = css.color_1;
    
    self.shareTitleLabel.font = css.fontOfH7;
    self.shareTitleLabel.textColor = css.color_4;
    
    [self.showWorkButton applyEllipseGreenBackgroundColor];
    
    self.shareContentView.backgroundColor = css.color_1;
    self.layer.cornerRadius = 4;
    
    WEAKSELF
    [self.qqImageView addTapGestureHandler:^(UITapGestureRecognizer *gestureRecognizer, UIView *view, CGPoint locationInView) {
        if (weakSelf.touchShareBlock) {
            weakSelf.touchShareBlock(FZCommonShareSocialSNSTypeQQ);
        }
    }];
    
    [self.weixinImageView addTapGestureHandler:^(UITapGestureRecognizer *gestureRecognizer, UIView *view, CGPoint locationInView) {
        if (weakSelf.touchShareBlock) {
            weakSelf.touchShareBlock(FZCommonShareSocialSNSTypeWeChatSession);
        }
    }];
    [self.weixinTimeLineImageView addTapGestureHandler:^(UITapGestureRecognizer *gestureRecognizer, UIView *view, CGPoint locationInView) {
        if (weakSelf.touchShareBlock) {
            weakSelf.touchShareBlock(FZCommonShareSocialSNSTypeWeChatTimeLine);
        }
    }];
    [self.qzoneImageView addTapGestureHandler:^(UITapGestureRecognizer *gestureRecognizer, UIView *view, CGPoint locationInView) {
        if (weakSelf.touchShareBlock) {
            weakSelf.touchShareBlock(FZCommonShareSocialSNSTypeQZone);
        }
    }];
}

- (IBAction)onShowWorkButton:(id)sender{
    if (self.touchShowWorkBlock) {
        self.touchShowWorkBlock(sender);
    }
}

@end
